home *** CD-ROM | disk | FTP | other *** search
- Path: news.itd.umich.edu!usenet
- From: Chris Lahey <clahey@umich.edu>
- Newsgroups: comp.lang.c
- Subject: Re: Fastest way to computer log(base2) of x?
- Date: 24 Jan 1996 22:56:31 GMT
- Organization: University of Michigan
- Message-ID: <4e6dev$ksl@lastactionhero.rs.itd.umich.edu>
- References: <4e61iu$p6e@villa.fc.net>
- NNTP-Posting-Host: rep00703.reshall.umich.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.12 (X11; I; Linux 1.2.13 i586)
- X-URL: news:4e61iu$p6e@villa.fc.net
-
- Depending on the speed of your FPU doing (int) log((double)x) / log(2.0) might
- be faster than checking each digit. I have absolutely no idea which is faster.
- Chris
-
-